export default ({
    state: {
        socket:null,
        onlineUser:[],
        chatUserId:'',
        chatUserPhoto:'',
        chatMessages:[],
    },
    getters: {
    },
    mutations: {
        UpdateOnlineUser(state,onlineUser){
            state.onlineUser = onlineUser;
        },
        UpdateSocket(state,socket){
            state.socket = socket
        },
        UpdateChatUser(state,chatUserId){
            state.chatUserId = chatUserId
        },
        // 更新聊天记录
        UpdateChatMessages(state,chatMessages){
            state.chatMessages = chatMessages
        },
        // 发送信息或接收信息，添加聊天记录
        AddChatMessage(state,message){
            state.chatMessages.push(message)
        },
        UpdateChatUserPhoto(state,photo){
            state.chatUserPhoto = photo;
        }
    },
    actions: {
    },
    modules:{
    }
})